<?
function titre($titre){
echo "
<table border=\"0\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\">
  <tr>
    <td width=\"37\"><img src=\"../../templates/default/titre/tgauche.gif\" width=\"37\" height=\"62\"></td>
    <td background=\"../../templates/default/titre/tmilieux.jpg\"><strong><u><font size=\"6\">$titre</font></u></strong</td>
    <td width=\"37\"><img src=\"../../templates/default/titre/tdroite.gif\" width=\"37\" height=\"63\"></td>
  </tr>
</table><br>";
}

//Affiche la barre pour les point de structure des batiments.
//***********************************************************
FUNCTION barstructure($pourc){
$pourc=$pourc*2;
echo"
<table width=\"100\" height=\"11\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#000000\" bgcolor=\"#CCCCCC\" background=\"../images/divers/bar01grille.gif\">
  <tr>
    <td><table width=\"$pourc\" height=\"11\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" background=\"../../images/divers/bar01.gif\">
        <tr><td></td></tr>
      </table></td>
  </tr>
</table>";
}


FUNCTION tribu_occuper($bat){


  $query=" SELECT SUM(invention_tribu/10) FROM TMPinvention WHERE invention_locid='$bat' AND invention_loc='b'";
                   $resultat=mysql_query($query);
             $tmp=mysql_fetch_row($resultat);
  $nbr=floor($tmp[0]);
  $query=" SELECT SUM(unite_tribu) FROM TMPunites WHERE unite_sloc='b' AND unite_ville='$bat'";
  $resultat=mysql_query($query);
  $tmp=mysql_fetch_row($resultat);

  $nbr+=$tmp[0];
  RETURN $nbr;


}
?>
